﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Farigola.Engine.SystemData.Entity.Type;

namespace Farigola.Engine.SystemData.Entity.inst
{
    /// <summary>
    /// Base class of instance class anonym.
    /// The other possible instance class is std.
    /// 
    /// An anonym class has its owner (and inner) type class.
    /// </summary>
    public class EntInstClassAnonym : EntInstClassBase
    {
        //=====================================================================
        // Constructors.

        //---------------------------------------------------------------------
        /**
         * constructor.
         * 
         * @param systOrUser
         * @param id
         * @param name
         */
        public EntInstClassAnonym(EntityDef.TypeSystOrUser systOrUser, EntTypeClassAnonym entTypeClass, EntityId id, String name)
            : base(systOrUser, entTypeClass, id, name)
        {            
        }

        //---------------------------------------------------------------------
        /**
         * constructor.
         * 
         * @param id
         * @param name
         */
        public EntInstClassAnonym(EntTypeClassAnonym entTypeClass, EntityId id, String name)
            : base(entTypeClass, id, name)
        {            
        }

        //=====================================================================
        // get/set Methods.

        //---------------------------------------------------------------------
        /**
         * Return the type class, need to build it on the fly, because
         * A type class anonym exists but is empty, contain no data member definition!
         * @return
         */
        public EntTypeClassAnonym getEntTypeClassAnonym()
        {
            return (EntTypeClassAnonym)_entTypeClassBase;
        }

        //=====================================================================
        // add/remove data member Methods.


        //---------------------------------------------------------------------
        /**
         * add the instDM to the inst class anonym.
         * 
         * @param entInstDM
         * @return
         */
        public bool addEntInstDataMember(EntInstBase entInstDM)
        {
            if (entInstDM == null)
                return false;

            // check that the name is not used by another instDM
            // todo: 

            // ok add the instDM to the inst class
            _listDataMember.Add(entInstDM);
            return true;
        }
    }
}
